package net.awpspace.mobile.management.point;

public class Time {
	private int ngay;
	private int thang;
	private int nam;
	
	
	public Time(int ngay, int thang, int nam) {
		super();
		this.setNgay(ngay);
		this.setThang(thang);
		this.setNam(nam);
	}
	public int getNgay() {
		return ngay;
	}
	public void setNgay(int ngay) {
		this.ngay = ngay;
	}
	public int getThang() {
		return thang;
	}
	public void setThang(int thang) {
		this.thang = thang;
	}
	public int getNam() {
		return nam;
	}
	public void setNam(int nam) {
		this.nam = nam;
	}
	public Time(String birth) {
		String part = "/";
		String day,month,year;
		int index = birth.indexOf(part);
		day = birth.substring(0, index);
		birth = birth.substring(index + 1);
		
		index = birth.indexOf(part);
		month = birth.substring(0, index);
		birth = birth.substring(index + 1);
		
		year = birth;
		this.setNgay(Integer.parseInt(day));
		this.setThang(Integer.parseInt(month));
		this.setNam(Integer.parseInt(year));
	}
	
	public String toString(){
		return ngay+"/"+thang+"/"+nam;
	}
	

}
